package com.igoal.utils;

/**
 * Convenient interface to synchronize attributes between 2 object. By default, all
 * the properties declared by get-set pattern in source object will be copied to
 * current object.<br> 
 * With specific case, the properties annotated with @SynchronizeWithOther will
 * be called. 
 * 
 * @author Khoi Pham
 *
 * @param <T> source object
 * @version 1.0
 */
public interface ISynchronizeObjectAttribute<T> {
	/**
	 * Initialize current object by attributes from another.
	 * @param from source object
	 */
	void initFrom(T from);
	
	/**
	 * Copy attributes to another object
	 * @param destObj dest object
	 */
	void copyAttributesTo(T destObj);
	
	/**
	 * Convert from current object into another.
	 * @param class of the destination object
	 * @return destination object
	 */
	T convertTo(Class<T> destCls);
}
